arm: imx: hab: Prefix authenticate_image with imx_hab
authorBryan O'Donoghue <[email protected]>
Fri, 12 Jan 2018 12:40:13 +0000 (12:40 +0000)
committerStefano Babic <[email protected]>
Sun, 14 Jan 2018 16:26:30 +0000 (17:26 +0100)
Tidy up the HAB namespace a bit by prefixing external functions with
imx_hab. All external facing functions past this point will be prefixed in
the same way to make the fact we are doing IMX HAB activities clear from
reading the code. authenticate_image() could mean anything
imx_hab_authenticate_image() is on the other hand very explicit.

Signed-off-by: Bryan O'Donoghue <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Albert Aribaud <[email protected]>
Cc: Sven Ebenfeld <[email protected]>
Cc: George McCollister <[email protected]>
Cc: Breno Matheus Lima <[email protected]>
Tested-by: Breno Lima <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
arch/arm/include/asm/mach-imx/hab.h
arch/arm/mach-imx/hab.c
arch/arm/mach-imx/spl.c

index 14e12203c229acde29b89dece9473cc95c14e5e6..98bc1bdc65e7011ca0162df3e7839c2329bf64d8 100644 (file)
@@ -185,7 +185,7 @@ typedef void hapi_clock_init_t(void);
 
 /* ----------- end of HAB API updates ------------*/
 
-int authenticate_image(uint32_t ddr_start, uint32_t image_size,
-                      uint32_t ivt_offset);
+int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
+                              uint32_t ivt_offset);
 
 #endif
index ec85548088b28cd613cfce93368533540cf657ce..7c2f82897b7fb98080244e6ae8c6883d03d7183b 100644 (file)
@@ -392,7 +392,7 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc,
        length = simple_strtoul(argv[2], NULL, 16);
        ivt_offset = simple_strtoul(argv[3], NULL, 16);
 
-       rcode = authenticate_image(addr, length, ivt_offset);
+       rcode = imx_hab_authenticate_image(addr, length, ivt_offset);
        if (rcode == 0)
                rcode = CMD_RET_SUCCESS;
        else
@@ -435,8 +435,8 @@ static bool is_hab_enabled(void)
        return (reg & IS_HAB_ENABLED_BIT) == IS_HAB_ENABLED_BIT;
 }
 
-int authenticate_image(uint32_t ddr_start, uint32_t image_size,
-                      uint32_t ivt_offset)
+int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
+                              uint32_t ivt_offset)
 {
        uint32_t load_addr = 0;
        size_t bytes;
index 141579dbad3999cf1d446145e9d2c3811653a826..6c16872f596f9b9ebeb6642eef572d38af48cde4 100644 (file)
@@ -199,8 +199,9 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
        /* HAB looks for the CSF at the end of the authenticated data therefore,
         * we need to subtract the size of the CSF from the actual filesize */
        offset = spl_image->size - CONFIG_CSF_SIZE;
-       if (!authenticate_image(spl_image->load_addr,
-                               offset + IVT_SIZE + CSF_PAD_SIZE, offset)) {
+       if (!imx_hab_authenticate_image(spl_image->load_addr,
+                                       offset + IVT_SIZE + CSF_PAD_SIZE,
+                                       offset)) {
                image_entry();
        } else {
                puts("spl: ERROR:  image authentication unsuccessful\n");